﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Framework;

namespace Enterprise.Admin.Handle.TeamStyle
{
    public partial class Edit : AdminBasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            object result;
            try
            {

                var filedata = new HttpPostedFileWrapper(Request.Files["Filedata"]);
                var id = Fq("CoTeamStyleId").SafeToInt();
                var name = Fq("CoName").SafeToString();
                var nameEn = Fq("CoNameEn").SafeToString();
                var description = Fq("CoDescription").SafeToString();
                var descriptionEn = Fq("CoDescriptionEn").SafeToString();
                var sorts = Fq("CoSort").SafeToInt();
                var teamStyleService = new TeamStyleService();
                teamStyleService.Eidt(id, name, nameEn, description, descriptionEn, sorts, filedata);
                result = (new { state = true, message = "修改成功！" });
            }
            catch (Exception ex)
            {

                result = (new { state = false, message = ex.Message });
            }
            Response.Write(result.Serialization());
            Response.End();


        }
    }
}